{% extends "base.html" %} {% block title %}图书列表{% endblock %} {% block
content %}
<div class="page">
  <div class="page__bd">
    <!-- 我的 -->
    <div class="weui-flex">
      <div class="weui-flex__item">
        <div class="placeholder"></div>
      </div>
      <div>
        <div class="placeholder">
          <a
            href="/my?page=1&page_size=5"
            role="button"
            class="weui-btn weui-btn_mini weui-btn_primary weui-wa-hotarea"
            >我的</a
          >
        </div>
      </div>
    </div>
    <!-- 搜索框 -->
    <div class="weui-search-bar" id="searchBar">
      <form class="weui-search-bar__form">
        <div class="weui-search-bar__box">
          <i class="weui-icon-search"></i>
          <input
            type="search"
            class="weui-search-bar__input"
            placeholder="搜索"
            required=""
          />
          <a href="javascript:" class="weui-icon-clear"></a>
        </div>
        <label class="weui-search-bar__label">
          <i class="weui-icon-search"></i>
          <span>搜索</span>
        </label>
      </form>
      <a href="javascript:" class="weui-search-bar__cancel-btn">取消</a>
    </div>
    <!-- 搜索框结束 -->
    <div class="weui-cells__title">图书列表</div>
    <div class="weui-cells">
      {% for book in books %}
      <a class="weui-cell weui-cell_access" href="/detailbook/{{book.id}}">
        <span class="weui-cell__bd">
          <span>{{ book.name }}</span>
        </span>
        <span class="weui-cell__ft"> </span>
      </a>
      {% endfor %}
      <!-- 上一页 和下一页 -->
      <div class="weui-flex">
        <div>
          <div class="placeholder">
            <a
              href="/listbook?{{prev_page}}"
              role="button"
              class="weui-btn weui-btn_mini weui-btn_default weui-wa-hotarea"
              >上一页</a
            >
          </div>
        </div>
        <div class="weui-flex__item">
          <div class="placeholder"></div>
        </div>
        <div>
          <div class="placeholder">
            <a
              href="/listbook?{{next_page}}"
              role="button"
              class="weui-btn weui-btn_mini weui-btn_default weui-wa-hotarea"
              >下一页</a
            >
          </div>
        </div>
      </div>
    </div>
  </div>
</div>

<script type="text/javascript">
  weui.searchBar("#searchBar");
</script>
{% endblock %}
